<%@ page language="java" pageEncoding="Windows-1256"
	contentType="text/html;charset=Windows-1256"%>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.google.appengine.api.rdbms.AppEngineDriver"%>
<%@ page import="java.util.Scanner"%>
<%@ page import="javax.mail.*"%>
<%@ page import="javax.mail.internet.*"%>
<%@ page import="javax.activation.*"%>
<%@ page import="com.google.appengine.api.users.User"%>
<%@ page import="com.google.appengine.api.users.UserService"%>
<%@ page import="com.google.appengine.api.users.UserServiceFactory"%>

<html>
<head>
<meta http-equiv="content-type"
	content="text/html; charset=Windows-1256">
	<link rel="stylesheet" type="text/css" href="mystyle.css">
	


</head>
<BODY>
			
<%!

public Connection createConn() throws SQLException {
		try {
			Connection connection = DriverManager
					.getConnection("jdbc:google:rdbms://cloudyssologin:gasp11/sso");
			return connection;
		} catch (SQLException e) {
			System.out.println("METHOD EXCEPTION");
			try {
				Thread.sleep(5000);
			} catch (Exception r) {
			}
			return createConn();
		}
	}
%>


<center>
<div style="width: 935px; clear: both;" align="center;"> <br>



<%
	
String username = request.getParameter("username");
String pass = request.getParameter("pass");

//String pass = request.getParameter("pass");	

	int countInc = 0;

try{
	Connection connection = createConn();
	Statement st = connection.createStatement();
	Statement check = connection.createStatement();
	
	
	request.setCharacterEncoding("Windows-1256");

	
	ResultSet rs ;
	

	rs=st.executeQuery("select * from ftest where username='"+username+"' and pass='"+pass+"'");
	
	
	if(rs.next())
	{
		out.println("Welcome "+username);
		}
		
		else
		{
			out.println("Wrong Credentials");
				
		}
	
}

catch (SQLException c)
{
	System.out.println("1 "+c);
}

		
		%>
</div>
</BODY>
</HTML>